import request from "@/utils/request";
import { LoginParamsType } from "./data";

export async function accountLogin(params: LoginParamsType): Promise<any> {
	if (params.role == 0) {
		return request({
			url: "/admin/login",
			method: "POST",
			data: params,
		});
	} else if (params.role == 1) {
		return request({
			url: "/owners/login",
			method: "POST",
			data: params,
		});
	} else if (params.role == 2) {
		return request({
			url: "/employees/login",
			method: "POST",
			data: params,
		});
	}
}
